<form style="padding:5px; width:100%;" id="frm-search" method="post" class="cari" action="<?php echo $own_links;?>search">
	<input type="hidden" name="column" value="all" />
	<img src="<?php echo themeUrl();?>images/cari.png" align="left" />
	<input type="text" name="keyword" value="<?php echo isset($key)?$key:'';?>" size="20" />
    <select name="column">
		<?php cat_search($cat_search);?>
    </select>
	<input type="text" id="dstart" name="dstart" value="<?php echo $this->jCfg['isearch']['start_date'];?>" size="8" class="picker"/> s/d 
	<input type="text" name="dend" id="dend" value="<?php echo $this->jCfg['isearch']['end_date'];?>" size="8" class="picker" />
	<input type="submit" name="cari" class="btn-cari" value="Cari" />
	<input type="button" onclick="document.location=SELF_URL" name="reset" class="btn-reset" value="Reset" />
    <?php 
		$pp = $this->jCfg['isearch']['per_page'];
		$st = isset($this->jCfg['isearch']['status'])?$this->jCfg['isearch']['status']:"all";
	?>
	<select style="padding:5px; height:30px; float:right; margin-right:10px; cursor:pointer;" name="per_page" class="item_submit">
		<option value="5" <?php echo ($pp=='5')?'selected="selected"':'';?> >5</option>
		<option value="10" <?php echo ($pp=='10')?'selected="selected"':'';?> >10</option>
		<option value="50" <?php echo ($pp=='50')?'selected="selected"':'';?>>50</option>
		<option value="100" <?php echo ($pp=='100')?'selected="selected"':'';?>>100</option>
		<option value="200" <?php echo ($pp=='200')?'selected="selected"':'';?>>200</option>
	</select>
    <select style="padding:5px; height:30px; float:right; margin-right:10px; cursor:pointer;" class="item_submit" name="status">
		<option value="all" <?php echo ($st=='all')?'selected="selected"':'';?>>-STATUS-</option>
        <option value="PROSES" <?php echo ($st=='PROSES')?'selected="selected"':'';?>>PROSES</option>
		<option value="ACCEPT" <?php echo ($st=='ACCEPT')?'selected="selected"':'';?>>ACCEPT</option>
		<option value="UPLOAD" <?php echo ($st=='UPLOAD')?'selected="selected"':'';?>>UPLOAD</option>
	</select>
</form>
<div class="clr"></div>
<?php echo $paging;?>
<div class="clr"></div>
<table class="data">
	<tr>
		<th width="10px">No</th>
        <th>Tanggal Proses</th>
		<th>Nama Asuransi</th>
        <th>Status</th>
        <th>Note</th>
		<th><b style="color:#FC0;"><?php echo $cRec;?> Data </b></th>
	</tr>
	<?php 
	if(count($data) > 0){
		$tmp_form_id="";
		foreach($data as $r){?>
        	<?php if($tmp_form_id != $r->form_id){ 
				$tmp_form_id = $r->form_id;
			?>
            <tr bgcolor="#FFFF66">
            	<td><?php echo ++$no;?>.</td>
                <td colspan="5"><b>Nama Oblige : <?php echo $r->form_obligee_name;?></b></td>
            </tr>		
            <?php } ?>
			<tr>
				<td></td>
                <td><?php echo ($r->tgl_proses!="")?myDate($r->tgl_proses):'<i>&raquo; Belum Di Proses</i>';?></td>
				<td><?php echo $r->asuransi_name;?></td>
                <td><?php echo $r->as_status;?></td>
                <td align="center">
                <?php
					// cek note ...
					$nnt=get_note(array(
							"form_id"		=> $r->form_id,
							"asuransi_id"	=> $r->asuransi_id
					));
					if(count($nnt)>0){	
						echo "<a href='".$own_links."get_note/".$r->form_id."/".$r->asuransi_id."' class='simple south' title='Read ?'>";
						echo ($nnt[0]->note_read=="0")?"<img src='".themeUrl()."images/unread.png'>":"<img src='".themeUrl()."images/read.png'>";
						echo "</a>";
					}					
				?>
                </td>
				<td align="right">
                	<?php if(_ac('edit')){
							if($r->as_status=='PROSES' || $r->as_status=='ACCEPT'){
						?>
                    	<a href="<?php echo $own_links."edit/".$r->as_id;?>" title="Edit Formulir">
                        	<img src="<?php echo themeUrl();?>images/edit.png" />
                        </a>
                        <?php } ?>
                    <?php } ?> 
					<?php link_action($links_table_item,$r->as_id);?>
				</td>
			</tr>
	<?php } 
	}
	?>
</table>
<?php echo $paging;?>
<script language="javascript">
$('.item_submit').change(function(){
	$('#frm-search').submit();
});
</script>